#include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
using namespace std;
int main() {
    int T;
    cin>>T;
    int n,m,k,tmp,z;
    int a,b,c;
    while (T--) {
        scanf("%d%d%d",&n,&m,&k);
        bool* li=new bool[n+1];
        int cnt[(n+1)/10+1];
        memset(cnt,0,sizeof(cnt));
        memset(li,0,sizeof(li));
        for (int i=0; i<k; i++) {
            scanf("%d",&tmp);
            li[tmp]=true;
            cnt[tmp/10]++;
        }
        int cn=0;
        int all;
        bool flag=false;
        for (int i=0; i<m; i++) {
            scanf("%d%d%d",&a,&b,&c);
            all=0;
            tmp=a/10;
            for(int j=a; j<(tmp+1)*10 && j<=b; j++) all++;
            tmp++;
            for(int j=tmp; j*10<=b; j++);
        }
        delete [] li;
    }
    return 0;
}
